<div class="categories index">
    <div class="clearfix">
        <p>
        <h2 class="pull-left col-md-4" ><span class="glyphicon glyphicon-th-list"></span>Danh Sách Các Mục</h2>
        <h2 class="pull-left"><?php echo $this->Html->link('', array('controller' => 'categories', 'action' => 'add'), array('class' => 'glyphicon glyphicon-plus-sign text-add', 'title' => 'Thêm Bài Viết')); ?></h2>
        </p>
    </div>
    <hr />
    <table class="table table-bordered table-hover col-md-12 col-xs-12 col-sm-12">
        <thead>
            <tr class="success">
                <th><?php echo $this->Paginator->sort('Số thứ tự'); ?></th>
                <th><?php echo $this->Paginator->sort('Mục Cha'); ?></th>
                <th><?php echo $this->Paginator->sort('Mục Chính'); ?></th>
                <th class="text-center"><?php echo __('Thao tác'); ?></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($categories as $category): ?>
                <tr>
                    <td class="col-md-1"><?php echo h($category['Category']['id']); ?>&nbsp;</td>
                    <td>
                        <?php echo $this->Html->link($category['ParentCategory']['name_category'], array('controller' => 'categories', 'action' => 'view', $category['ParentCategory']['id'])); ?>
                    </td>
                    <td><?php echo h($category['Category']['name_category']); ?>&nbsp;</td>
                    <td class="actions text-center">
                        <?php echo $this->Html->link(__(''), array('action' => 'view', $category['Category']['id']), array('class' => 'glyphicon glyphicon-eye-open text-success', 'title' => 'Xem')); ?>
                        &nbsp;&nbsp;
                        <?php echo $this->Html->link(__(''), array('action' => 'edit', $category['Category']['id']), array('class' => 'glyphicon glyphicon-edit text-warning', 'title' => 'Sửa')); ?>
                        &nbsp;&nbsp;
                        <?php echo $this->Form->postLink(__(''), array('action' => 'delete', $category['Category']['id']), array('class' => 'glyphicon glyphicon-trash text-danger', 'title' => 'Xóa'), __('Are you sure you want to delete # %s?', $category['Category']['id'])); ?>
                    </td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    <div class="text-center">
        <ul class="pagination pagination-sm">
            <?php
            echo '<li class="disabled">' . $this->Paginator->prev('« ' . __('Trang sau'), array(), null, array('class' => 'prev')) . "</li>";
            echo '<li>' . $this->Paginator->numbers(array('separator' => '')) . "</li>";
            echo '<li class="disabled">' . $this->Paginator->next(__('Trang trước') . ' »', array(), null, array('class' => 'next disabled')) . "</li>";
            ?>
        </ul>
    </div>
</div>
